package vip.sone.shiro.permission;

import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.RolePermissionResolver;

import java.util.Collection;
import java.util.HashSet;

public class JdbcPermissionResolver implements RolePermissionResolver {
    @Override
    public Collection<Permission> resolvePermissionsInRole(String roleString) {
        Collection<Permission> permissions = new HashSet<>();
        String[] roles = roleString.split(",");
        for (String role : roles) {
            // String id = RoleDao.findByRoleName().getID();
            // Set<RolePermission> rolePermissions = RolePermissionDao.findByRoleID(id);
            // for (String permission : rolePermissions) permissions.add(PermissionDao.findByName(permission));
        }
        return null;
    }
}
